package com.itlong.cloud.user.smartcard;

import com.itlong.cloud.POJO.DTO.smartcard.SmartCardOldAuthDoorDTO;
import com.itlong.cloud.POJO.DTO.smartcard.SmartCardOldAuthFloorDTO;
import com.itlong.cloud.POJO.DTO.smartcard.SmartCardOldUserInfoDTO;
import com.itlong.cloud.POJO.VO.smartcard.SmartCardOldLoginVO;
import com.itlong.cloud.POJO.VO.smartcard.SmartCardOldUserInfoVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <desc>
 *      旧一卡通_用户模块暴露接口。
 * <desc/>
 *
 * @createDate 2017/11/2.
 */
@FeignClient(name="user-service")
public interface ISmartCardOldUserInfoServiceClient {

     /**
      * <desc>
      *      获取单个用户所有信息列表。
      * <desc/>
      *
      * @return phoneNO 手机号
      * @author shengen.T
      * @createDate 2017/11/2
      */
     @RequestMapping(path = "/sys/user/manage/list")
     List<SmartCardOldUserInfoVO> getUserInfoList(@RequestParam("phoneNO") String phoneNO) throws Exception;

      /**
       * <desc>
       *      旧一卡通登录。
       * <desc/>
       *
       * @param  account 当前登录账号
       * @param  pswd 密码
       * @return
       * @author shengen.T
       * @createDate 2017/11/2
       */
     @RequestMapping(path = "/sys/user/manage/login")
     SmartCardOldLoginVO login(@RequestParam("account") String account,@RequestParam("pswd") String pswd) throws Exception;

      /**
       * <desc>
       *      一卡通检测手机号码是否存在。
       * <desc/>
       *
       * @param  phoneNo 手机号码
       * @return true 存在 false 不存在
       * @author shengen.T
       * @createDate 2017/11/3
       */
     @RequestMapping(path = "/sys/user/manage/phone")
     boolean checkPhone(@RequestParam("phoneNo") String phoneNo) throws Exception;

    /**
     * <desc>
     *      旧一卡通_修改用户。
     * <desc/>
     *
     * @param updateDTO 更新数据
     * @return 返回影响行数
     * @author shengen.T
     * @createDate 2017/11/3
     */
     @RequestMapping(path = "/sys/user/manage/update")
     Integer update(@RequestBody SmartCardOldUserInfoDTO updateDTO) throws Exception;

    /**
     * <desc>
     *      旧一卡通_授权门禁
     * <desc/>
     *
     * @param authDoorDTO 门禁权限
     * @return
     * @author Chunjian.G
     * @createDate 2017-12-09
     */
    @RequestMapping(path = "/sys/user/manage/authDoor")
    Integer authDoor(@RequestBody SmartCardOldAuthDoorDTO authDoorDTO,
                     @RequestParam("isSmartCommunity") Integer isSmartCommunity) throws Exception;

    /**
     * <desc>
     *        旧一卡通_授权电梯
     * <desc/>
     *
     * @param authFloorDTO 电梯权限
     * @return
     * @author Chunjian.G
     * @createDate 2017-12-09
     */
    @RequestMapping(path = "/sys/user/manage/authFloor")
    Integer authFloor(@RequestBody SmartCardOldAuthFloorDTO authFloorDTO,
                      @RequestParam("isSmartCommunity") Integer isSmartCommunity) throws Exception;


      /**
       * <desc>
       *      获取缓存中的账户信息。
       * <desc/>
       *
       * @param  token
       * @return 返回账户信息
       * @author shengen.T
       * @createDate 2017/11/17
       */
    @RequestMapping(path = "/smartCard/getToken")
    SmartCardOldLoginVO retrieve(@RequestParam("token") String token) throws Exception;


}
